package com.yeziji.dataCenter.business.record.entity.table;

import com.mybatisflex.core.query.QueryColumn;
import com.mybatisflex.core.table.TableDef;


/**
* 数据中心最大 id 记录表 表定义层。
*
* @author system
* @since 2024-10-26
*/
public class DataCenterMaxIdRecordTableDef extends TableDef {

    private static final long serialVersionUID = 1L;

    /**
     * 数据中心最大 id 记录表
     */
    public static final DataCenterMaxIdRecordTableDef DATA_CENTER_MAX_ID_RECORD = new DataCenterMaxIdRecordTableDef();

    /**
     * 自增 id
     */
    public final QueryColumn ID = new QueryColumn(this, "id");

    /**
     * 业务类型：DataCenterMaxIdTypeEnum
     */
    public final QueryColumn TYPE = new QueryColumn(this, "type");

    /**
     * 最大值 id
     */
    public final QueryColumn MAX_ID = new QueryColumn(this, "max_id");

    /**
     * 创建时间
     */
    public final QueryColumn CREATE_TIME = new QueryColumn(this, "create_time");

    /**
     * 更新时间
     */
    public final QueryColumn UPDATE_TIME = new QueryColumn(this, "update_time");

    /**
     * 所有字段。
     */
    public final QueryColumn ALL_COLUMNS = new QueryColumn(this, "*");

    /**
     * 默认字段，不包含逻辑删除或者 large 等字段。
     */
    public final QueryColumn[] DEFAULT_COLUMNS = new QueryColumn[]{ID, MAX_ID, TYPE, CREATE_TIME, UPDATE_TIME};

    public DataCenterMaxIdRecordTableDef() {
        super("", "data_center_max_id_record");
    }

    private DataCenterMaxIdRecordTableDef(String schema, String name, String alisa) {
        super(schema, name, alisa);
    }

    public DataCenterMaxIdRecordTableDef as(String alias) {
        String key = getNameWithSchema() + "." + alias;
        return getCache(key, k -> new DataCenterMaxIdRecordTableDef("", "data_center_max_id_record", alias));
    }

}